package com.laijiale.config;

/**
 * @author laijiale
 * @date 2025年01月09日 11:33
 */

import io.swagger.v3.oas.models.OpenAPI;
import io.swagger.v3.oas.models.info.Contact;
import io.swagger.v3.oas.models.info.Info;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

@Configuration
public class SpringDocConfig {

    private final String AUTHOR = "LaiJiaLe";
    private final String URL = "http://localhost:5300";
    private final String TITLE = "ml-course";
    private final String DESCRIPTION = "<em>MyLesson - 课程微服务</em>";
    private final String VERSION = "v1.0.0";

    /** 通用信息Bean */
    @Bean
    public OpenAPI commonInfo() {
        return new OpenAPI().info(new Info()
                .title(TITLE)
                .description(DESCRIPTION)
                .version(VERSION)
                .contact(new Contact().name(AUTHOR).url(URL)));
    }
}